

/*
This do-file reproduces Figure A1 of the paper "Dismantling the \Jungle":
Migrant Relocation and Extreme Voting in France", by P. Vertier, M. Viskanic, and M. Gamalerio


*/

log using "Figure A1", replace text

clear

use "Figure A1 dataset.dta"


reg log_fn CAO_period_2 CAO_period_3 CAO_period_4 CAO_period_5 i.period , cluster( codeinsee) absorb(codeinsee)

capture drop coeff*
capture drop se*
capture drop hi*
capture drop low*
capture drop time

gen coeff1=_b[CAO_period_2]
gen se1=_se[CAO_period_2]
gen hi1=coeff1+1.96*se1
gen low1=coeff1-1.96*se1


gen coeff2=_b[CAO_period_3]
gen se2=_se[CAO_period_3]
gen hi2=coeff2+1.96*se2
gen low2=coeff2-1.96*se2


gen coeff3=_b[CAO_period_4]
gen se3=_se[CAO_period_4]
gen hi3=coeff3+1.96*se3
gen low3=coeff3-1.96*se3

gen coeff4=_b[CAO_period_5]
gen se4=_se[CAO_period_5]
gen hi4=coeff4+1.96*se4
gen low4=coeff4-1.96*se4


capture drop time
gen time=_n
replace time=. if time>4

capture drop coeff hi low
gen coeff=.
gen hi=.
gen low=.

foreach i of numlist 1/4 {
replace coeff=coeff`i' if time==`i'
replace hi=hi`i' if time==`i'
replace low=low`i' if time==`i'
}

twoway (scatter coeff time)(rcap hi low time), graphregion(color(white)) note("95% CI, Coeff of CAO on the log of FN vote (FE regression)") xlab(1 "Pres '12" 2 "Euro' 14" 3 "Reg' 15" 4 "Pres '17",labsize(small)) legend(off) xtitle("") 

graph export "Figure A1.png", replace

log close



